package dmp.dianxin;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

public class NumProducer {
	public static void main(String[] args) throws Exception {
		List<String> prefix = DianxinList.elements();
		List<String> sufix = getSufix();
		List<String> nums=new ArrayList<>();
		String num=null;
		String local="";
		FileWriter writer=new FileWriter(new File("dianxin3"));
		for (String each : prefix) {
			String pre=each.split(",")[0];
			pre=pre.substring(1, pre.length()-1);
			local=each.split(",")[1];
			local=local.substring(1, local.length()-1);
			for (String suf : sufix) {
				num=pre+suf;
				String md5str=ParseMD5.parseStrToMd5U32(num);
				writer.write(md5str+","+num+","+local+"\r\n");
//				nums.add(num);
//				System.out.println(num);
			}
//			System.out.println(pre.subSequence(1, pre.length()-1));
		}
		
		writer.close();
		
	}
	
	public static List<String> getSufix(){
		List<String> result=new ArrayList<>();
		for(int i=0;i<10000;i++){
			String num=String.format("%04d", i);
			result.add(num);
//			System.out.println(num);
		}
		return result;
	}
	
	
}
